#!/usr/local/bin/Resource/www/cgi-bin/php
<?php
error_reporting(0);
$host = "http://127.0.0.1/cgi-bin";
$p=$_SERVER['SCRIPT_FILENAME'];
$script_directory = substr($p, 0, strrpos($p, '/'));
$f_version=$script_directory."/version.txt";
if (file_exists($f_version)) {
  $curr_vers=trim(file_get_contents($script_directory."/version.txt"));
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "http://hdforall.uphero.com/version.srt");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION  ,1);
  $h = curl_exec($ch);
  curl_close($ch);
  $avb_vers=trim($h);
if ($avb_vers <> $curr_vers) {
  $info = "O nouă versiune este disponibilă (".$avb_vers.")! Actualizaţi din meniul System Tools.";
} else {
  $info = "Sfat: Folosiţi tastele 1-9 sau PREV/NEXT pentru o navigare mai uşoară.";
}
} else {
  $info = "Sfat: Folosiţi tastele 1-9 sau PREV/NEXT pentru o navigare mai uşoară!";
}
$f = "/usr/local/bin/home_menu";
if (file_exists($f)) {
  $file = "/usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss";
  $h=file_get_contents($file);
  if (strpos($h,"eboda") === false) {
    exec("cp /usr/local/etc/www/cgi-bin/scripts/filme/videoRenderer.rss /usr/local/etc/www/cgi-bin/scripts/util/videoRenderer.rss");
    exec("cp /usr/local/etc/www/cgi-bin/scripts/filme/videoRenderer_h.rss /usr/local/etc/www/cgi-bin/scripts/util/videoRenderer_h.rss");
  }
}
print $info;
?>
